﻿@using X.PagedList;
@using X.PagedList.Mvc.Common;
@using X.PagedList.Mvc.Core;
@using FwProject.Settlement.Dto
@model IPagedList<SettlementInfoDto>
@{
    Layout = null;
    int i = 0;
    if (Model.Count > 0)
    {
        if (Model.PageNumber != 1)
        {

            i = (Model.PageNumber - 1) * Model.PageSize;
        }
    }
    decimal Sumprice = 0;
}
<div>

    <table class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th style="width:45px">序号</th>
                <th>状态</th>
                <th>应收类型</th>
                <th>餐厅</th>
                <th>开单日期</th>
                <th>单号</th>
                <th>配送日期</th>
                <th>金额</th>
                @*<th>已收金额</th>
                    <th>未收金额</th>*@
            </tr>
        </thead>
        <tbody>
            @if (Model.Count == 0)
            {
                <tr><td colspan="8" align="center">暂无数据</td></tr>
            }
            else
            {
                foreach (var item in Model)
                {
                    Sumprice += item.Actualprice;
                    i++;
                    <tr>
                        <td>@i</td>
                        <td>@item.RestaurantPayStatus</td>
                        <td>@item.BalanceWayEnum</td>
                        <td>@item.RestaurantInfoModel.RestaurantName</td>
                        <td>@item.CreationTime.ToString("yyyy-MM-dd")</td>
                        <td><a href="javascript:top.window.openTab(1578,'收据[@item.CreationNumber]','/Receipt/SettlementDetails?id=@item.Id')">@item.CreationNumber</a></td>
                        <td>@item.DeliveryDate</td>
                        <td>@item.Actualprice</td>
                    </tr>
                }
                <tr class="footer">
                    <td>合计</td>
                    <td colspan="6"></td>
                    <td>@Sumprice</td>
                </tr>
            }
        </tbody>
    </table>
</div>
<div class="row pagedinfo">
    <div class="col-sm-5">
        共 @Model.TotalItemCount 条，@Model.PageSize 条/页 当前第 @Model.PageNumber/@Model.PageCount 页
    </div>
    <div class="col-sm-7">
        @Html.PagedListPager(Model, page => Url.Action("Index", new { pageIdx = page, beginTime = Context.Request.Query["beginTime"], endTime = Context.Request.Query["endTime"] }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { AllowCache = false, HttpMethod = "Get", UpdateTargetId = "data_list", OnSuccess = "AjaxSuccessCallback", OnBegin = "AjaxBegin" }))
    </div>
</div>


